home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / gui / muibuilderv11.lha / muibuilder / mb / c / locale / SmallMain.c < prev    next >
C/C++ Source or Header  |  1994-03-06  |  2KB  |  70 lines

  1. /* Libraries */
  2. #include <libraries/mui.h>
  3.  
  4. /* protos */
  5. #include <clib/muimaster_protos.h>
  6. #include <clib/alib_protos.h>
  7. #include <clib/dos_protos.h>
  8. #include <clib/exec_protos.h>
  9.  
  10. /*  Pragmas  */
  11. #include <pragmas/muimaster_pragmas.h>
  12. #include <pragmas/exec_pragmas.h>
  13.  
  14. /*  Ansi  */
  15. #include <stdlib.h>
  16. #include <stdio.h>
  17.  
  18. /* MUIBuilder */
  19. #include "Small_Example.h"
  20.  
  21. /* Locale */
  22. #include "Small_Example_cat.h"
  23.  
  24. struct Library * MUIMasterBase, * LocaleBase;
  25.  
  26. /* Init function */
  27. static void init( void )
  28. {
  29.     if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN)))
  30.     {
  31.         printf("Can't Open MUIMaster Library");
  32.         exit(20);
  33.     }
  34. }
  35.  
  36. /* main function */
  37. main()
  38. {
  39.     struct ObjApp * App = NULL;    /* Application object */
  40.     BOOL    running = TRUE;
  41.     ULONG    signal;
  42.     extern struct ObjApp * CreateSmall_Example( void );
  43.  
  44.     /* Program initialisation ( you need to write it yourself) */
  45.     init();
  46.  
  47.     /* Create Application : generated by MUIBuilder */
  48.     App = CreateApp();
  49.  
  50.     /* Notification */
  51.     DoMethod(App->WI_smallexample, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, App->App, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
  52.     DoMethod( App->BT_ok, MUIM_Notify, MUIA_Pressed, FALSE, App->App, 2, MUIM_Application_ReturnID,  MUIV_Application_ReturnID_Quit);
  53.     DoMethod( App->BT_cancel, MUIM_Notify, MUIA_Pressed, FALSE, App->App, 2, MUIM_Application_ReturnID,  MUIV_Application_ReturnID_Quit);
  54.     
  55.     /* Open Window */
  56.     set( App->WI_smallexample, MUIA_Window_Open, TRUE );
  57.  
  58.     while (running)
  59.         {
  60.                 switch (DoMethod(App->App,MUIM_Application_Input,&signal))
  61.                 {
  62.                 case MUIV_Application_ReturnID_Quit:
  63.                         running = FALSE;
  64.                         break;
  65.                 }
  66.     if (running && signal) Wait(signal);
  67.         }
  68.     DisposeApp(App);
  69. }
  70.